﻿<img src="1.jpg" id="pic" />

<input type="button" value="上一张" onclick="shangYiZhang()" />
<input type="button" value="下一张" onclick="xiaYiZhang()" />

<script>
	var i = 1;
	
	function shangYiZhang(){
		  i = i - 1;
                  pic.src = i+".jpg";
	}
	function xiaYiZhang(){
		  i = i + 1;
                  pic.src = i+".jpg";
	}	
	
</script>
